package matricula.action;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.Query;

import matricula.model.Alumno;
import matricula.util.Utilitario;

public class ConsultarAlumnosAction {

	private List<Alumno> alumnos;
	
	public String execute(){
		String retorno="exito";
		EntityManager em = Utilitario.getInstance().
							getEntityManager();
		Query query=em.createQuery("Select o From Alumno o");
		alumnos= query.getResultList();
		return retorno;
	}

	public List<Alumno> getAlumnos() {
		return alumnos;
	}

	public void setAlumnos(List<Alumno> alumnos) {
		this.alumnos = alumnos;
	}
	
	
}
